package com.liar.modular.system.controller;


import com.alibaba.fastjson.JSON;
import com.liar.base.BaseController;
import com.liar.base.ResultModel;
import com.liar.modular.system.entity.SysMenu;
import com.liar.modular.system.service.ISysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lk123
 * @since 2020-07-03
 */
@RestController
@RequestMapping("/system/menu")
public class SysMenuController extends BaseController {

    @Autowired
    private ISysMenuService iSysMenuService;

    @RequestMapping(value = "menuList",method = RequestMethod.GET,produces = "text/json;charset=UTF-8")
    public String menuList(){
        logBefore(logger,"菜单列表");
        ResultModel resultModel = new ResultModel();
        List<SysMenu> sysMenus = iSysMenuService.menuList();
        resultModel.setStatus("200");
        resultModel.setSuccess(true);
        resultModel.setData(sysMenus);
        return JSON.toJSONString(resultModel);

    }

}

